﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StorageList2.aspx.cs" Inherits="HHMMS.UI.Modules.StorageManager.StorageList2" MasterPageFile="~/Layouts/List.Master" %>

<asp:Content ContentPlaceHolderID="head" ID="idFormTitle" runat="server">
   <title>维修良好配件或材料</title> 
</asp:Content>

<asp:Content ID="idContent" ContentPlaceHolderID="Content" runat="Server">   
    <!-- 搜索框 -->
	<div class="search" style="margin-top:2px;">
        <web:search ID="GridSearch" GridViewId="SmartGridView1" runat="server">            
            <SearchConditionTemplate>                                       
                <table cellpadding="0" cellspacing="0" width="95%">
			        <tr>
                        <th>
                            开始日期：
                        </th>
                        <td>
                            <web:DatePicker ID="dpCreateDtStart" Name="beginTime" runat="server" DateTimeFormat="yyyy-MM-dd"
                                validator="required"></web:DatePicker>
                        </td>
                        <th>
                            结束日期：
                        </th>
                        <td>
                            <web:DatePicker ID="dpCreateDtEnd" Name="endTime" runat="server" DateTimeFormat="yyyy-MM-dd"
                                validator="required"></web:DatePicker>
                        </td> 
                        <th>
                            物资编号：
                        </th>
                        <td>
                            <asp:TextBox ID="txtMaterialsNo" name="MaterialsNo" CssClass="txtSelect" runat="server"></asp:TextBox>
                        </td>                                     
                    </tr>
                    <tr>
                        <th>
                            物资名称：
                        </th>
                        <td>
                            <asp:TextBox ID="txtMaterialsName" name="MaterialsName" CssClass="txtSelect" runat="server"></asp:TextBox>
                        </td>
                        <th>
                            物资规格（型号）：
                        </th>
                        <td>
                            <asp:TextBox ID="txtMaterialsModel" name="MaterialsModel" CssClass="txtSelect" runat="server"></asp:TextBox>
                        </td>
                        <th>
                            送料人：
                        </th>
                        <td>
                            <asp:TextBox ID="txtFeeding" name="Feeding" CssClass="txtSelect" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            收料人：
                        </th>
                        <td>
                            <asp:TextBox ID="txtClosing" name="Closing" CssClass="txtSelect" runat="server"></asp:TextBox>
                        </td>
                        <th>
                            操作人员：
                        </th>
                        <td>
                            <asp:TextBox ID="txtCreator" name="Creator" CssClass="txtSelect" runat="server"></asp:TextBox>
                        </td>
                        <th>
                            备注：
                        </th>
                        <td>
                            <asp:TextBox ID="txtRemark" name="Remark" CssClass="txtSelect" runat="server"></asp:TextBox>
                         <asp:TextBox ID="txtOrgId" name="OrgId" CssClass="txtSelect" Visible="false" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                      <tr>
                      <th>
                            架子：
                        </th>
                        <td>
                            <asp:TextBox ID="txtFrame" name="Frame" CssClass="txtSelect" runat="server"></asp:TextBox>
                        </td>
                          <th>
                            层：
                        </th>
                        <td>
                            <asp:TextBox ID="txtLevel" name="Level" CssClass="txtSelect" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </SearchConditionTemplate>                      
        </web:search>        
    </div>

    <div class="datalist">
	    <!-- 标题头 -->
	    <h2 style="height:30px;">
				 维修良好配件或材料列表
	    </h2>
	    <!-- 工具栏 -->
	    <div class="toolbar"  style="height:30px;">
            <asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkButtonExport_Click">
                <span>
                    <img id="Img2" alt="" runat="server" src="~/Images/icon_excel.gif" style="border: 0px" />导出
                </span>
            </asp:LinkButton>
            <asp:LinkButton ID="LinkButton1" runat="server"
                OnClientClick="return openEditor(this, 'Insert');" OnClick="SearchGrid">
                <span>
                    <img alt="" runat="server" id="img1" src="~/Images/icon_new.gif" style="border: 0px" />新建
                </span>
            </asp:LinkButton>            
	    </div>
	    <div class="datagrid"  style="clear:left;">    
            <!--------------------------- List Area --------------------------->
            <web:SmartGridView ID="SmartGridView1" runat="server" AutoGenerateColumns="False"
                Width="100%" DataKeyNames="Id" DataSourceID="SmartDataSource1" PageSize="10" onrowdatabound="SmartGridView1_RowDataBound">
                <Columns>  
                    
                    <asp:BoundField DataField="StorageTime" HeaderText="入库时间" SortExpression="StorageTime" ItemStyle-HorizontalAlign="left" />
                    <asp:BoundField DataField="MaterialsNo" HeaderText="物资编号" SortExpression="MaterialsNo" ItemStyle-HorizontalAlign="left" />
                    <asp:BoundField DataField="MaterialsName" HeaderText="物资名称"  ItemStyle-HorizontalAlign="center" SortExpression="MaterialsName"/>
                    <asp:BoundField DataField="MaterialsModel" HeaderText="物资规格（型号）" ItemStyle-HorizontalAlign="center" SortExpression="MaterialsModel"/>
                    <asp:BoundField DataField="StorageNum" HeaderText="进库数量" ItemStyle-HorizontalAlign="left" SortExpression="StorageNum" />
                    <asp:BoundField DataField="unit" HeaderText="计量单位" ItemStyle-HorizontalAlign="left" SortExpression="unit"/>
                    <asp:BoundField DataField="price" HeaderText="单价" ItemStyle-HorizontalAlign="left" SortExpression="price"/>
                    <asp:BoundField DataField="Amount" HeaderText="总金额" ItemStyle-HorizontalAlign="left" SortExpression="Amount" />
                    <asp:BoundField DataField="Feeding" HeaderText="送料人" ItemStyle-HorizontalAlign="left"  SortExpression="Feeding"/>
                    <asp:BoundField DataField="Closing" HeaderText="收料人" ItemStyle-HorizontalAlign="left" SortExpression="Closing"/>
                    <asp:BoundField DataField="Frame" HeaderText="架子" ItemStyle-HorizontalAlign="left" SortExpression="Frame" />
                    <asp:BoundField DataField="Level" HeaderText="层" ItemStyle-HorizontalAlign="left" SortExpression="Level" />
                    <asp:BoundField DataField="Creator" HeaderText="操作人员" ItemStyle-HorizontalAlign="left" SortExpression="Creator" />
                    <asp:BoundField DataField="RepairTime" HeaderText="送修时间" ItemStyle-HorizontalAlign="left" SortExpression="RepairTime" />
                    <asp:BoundField DataField="RepairTeam" HeaderText="承修班组" ItemStyle-HorizontalAlign="left" SortExpression="RepairTeam" />
                    <asp:BoundField DataField="Remark" HeaderText="备注" ItemStyle-HorizontalAlign="left" SortExpression="Remark" />
                    <asp:TemplateField HeaderText="操作">
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                        <ItemTemplate>
                            <table width="46px">
                                <tr>
                                    <td style="border: 0px solid #fff;">
                                        <asp:ImageButton ID="ibtnEdit" runat="server" ToolTip="修改" _KeyId='<%#Eval("Id")%>'
                                            ImageUrl="~/images/com/dg_edit.gif" CausesValidation="False" OnClientClick="return openEditor(this, 'Edit');" OnClick="RefreshGrid">
                                        </asp:ImageButton>
                                    </td>
                                    <td style="border: 0px solid #fff;">
                                        <asp:ImageButton ID="ibtnDelete" runat="server" ToolTip="删除" ImageUrl="~/images/com/dg_del.gif" _KeyId='<%#Eval("Id")%>'
                                          OnClientClick="return confirm('您确认要删除吗?')" OnClick="DeleteDictionaryItem">
                                        </asp:ImageButton>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <PagerSettings />
                <EditRowStyle HorizontalAlign="Center" />
            </web:SmartGridView>
    
            <web:SmartSqlDataSource ID="SmartDataSource1" runat="server" SelectCommand="Storage2.list" SelectCountCommand="Storage2.list.count"
            SelectCommandAutoPageWrap="true" DefaultSortExpression="StorageTime desc">       
                        
            </web:SmartSqlDataSource>
        </div>
	</div>

    <script type="text/javascript">

        function openEditor(_this, action) {
            var url = "StorageEdit2.aspx";

            // FormViewMode : Insert/Edit/ReadOnly
            var params = { FormViewMode: action }
            if (action == "Insert") {
                params.title = "添加新购配件或材料";
            } else if (action == "Edit") {
                params.title = "编辑新购配件或材料";
                params.Id = _this.attributes["_KeyId"].value;
            }

            var returnValue = showCenterModalDialog(buildUrl(url, params), 800, 350);
            if (returnValue == "true") {
                return true;
            }
            return false;
        }

    </script>
</asp:Content>
